13.09.2009, 20:50
Hey All!
Here i Will Show You How To Make A Simple Teleport Command!
First Of All: You Will Need Some Experience On "SetPlayerPos"This Will Go On "OnPlayerCommandText"
pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, //PUT HERE THE PLAYER POSITION);
SendClientMessage (playerid, //COLOR , "//MESSAGE");
return 1;
}
}
return 0;
}
Example, Sending Money "GivePlayerMoney(playerid,//AMMOUNT)"
pawn Code:
if (strcmp("/grove", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
SendClientMessage(playerid, COLOR_RED , "Hey");
GivePlayerMoney(playerid,500);
return 1;
}
}
return 0;
}
Get Guns Id From https://sampwiki.blast.hk/wiki/Weapons "GivePlayerWeapon(playerid, 31, 9999);"
pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
SendClientMessage(playerid, COLOR_RED , "Hey");
GivePlayerWeapon(playerid, 31, 9999); //31 IS THE M4, 9999 IS AMMO
return 1;
}
}
return 0;
}
pawn Code:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, //PLAYER POSITION);
SendClientMessage(playerid, //COLOR , "//MESSAGE");
SetPlayerHealth(playerid, 100); //100 IS THE PLAYER HEALTH CHANGE IT IF U WANT
SetPlayerArmour(playerid, 100); //100 IS THE PLAYER ARMOUR CHANGE IT IF U WANT
return 1;
}
}
return 0;
}
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/shoot", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1457.7526,-1062.9589,213.3828);
SendClientMessage(playerid, COLOR_RED , "Ready To Shoot!");
GivePlayerWeapon(playerid, 31, 9999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
}
return 0;
}
Please Reply If It Was HelpFul!