Saturday, November 13, 2010

SAMP Scripting Tutorial: Commands | Teleports | Load Vehicles From File

Here is the code

AddStaticVehicle(463,1902.3207,-2628.8757,13.0872,331.3780,11,11); // plane1
AddStaticVehicle(463,1873.3972,-2632.1284,13.0865,327.7260,11,11); // plane 2
AddStaticVehicle(463,1832.3038,-2623.2688,13.0865,344.0137,11,11); // plane3
AddStaticVehicle(463,1793.9832,-2626.4341,13.0861,349.1461,11,11); // plane4
AddStaticVehicle(463,1889.4199,-2579.3552,13.0865,267.0306,11,11); // plane5
AddPlayerClass(280,1885.7004,-2592.2048,13.5469,174.9667,0,0,0,0,0,0); // tele
// OnPlayerConnect
new message[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(message,sizeof(message),"~r~Hello %s !",name);
GameTextForPlayer(playerid,message,10000,6);

// OnPlayerCommandText
new cmd[128],idx;
cmd = strtok(cmdtext,idx);
if(strcmp(cmd,"/tele",true)==0)
{
 new tmp[128];
 tmp = strtok(cmdtext,idx);
 if(strlen(tmp)==0) return SendClientMessage(playerid,WHITE,"Usage: /tele 1");
 if(strval(tmp)==1)
  SetPlayerPos(playerid,1885.7004,-2592.2048,13.5469);
    else return SendClientMessage(playerid,WHITE,"Usage: /tele 1");
 return 1;
}

2 comments:

  1. It’s really a nice and helpful piece of information. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

    ReplyDelete
  2. Hey! I would like to wish you really and Merry Christmas. I believe that new year will be much more succesful for us. It is ideal oportunity to make friends and it is time to be glad. I have read this article and if I may I would suggest you some valuable things or advice. Maybe you could create more posts reffering to this post. I would love to read more information about it!

    ReplyDelete