Help With Teleports
#1

how i can make teleport what teleports only to home By 1 name like : Only For Name Kalvi

Код:
if (strcmp("/home", cmdtext, true, 10) == 0)
{
new name[24]:
GetPlayerName(playerid, name, sizeof(name));
if(!strcmp(name,"Kalvi",false))
SetPlayerPos(playerid, -2523.8162,2239.3862,5.3984, 334.7503);
SetPlayerInterior(playerid, 0);
return 1;
}
Reply
#2

if i add this code then it gives error:

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(472) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(515) : error 001: expected token: ";", but found ":"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(515) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(518) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(687) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#3

pawn Код:
if(strcmp(name, "Kalvi", true) == 0)
{
//teleport
}
Reply
#4

added code
Код:
if(strcmp(name, "[KFS]_Kalvi", true) == 0)
{
SetPlayerPos(playerid, -2523.8162,2239.3862,5.3984, 334.7503);
return 1;
}
ERROR:

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(470) : error 017: undefined symbol "name"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(472) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(477) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(684) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

Quote:
Originally Posted by dice7
pawn Код:
if(strcmp(name, "Kalvi", true) == 0)
{
//teleport
}
This is just an example on how to use strcmp correctly, since you're using it wrong in your code
Reply
#6

pawn Код:
if (strcmp("/home", cmdtext, true, 10) == 0)
{
new name[24];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "Kalvi", true) == 0)
{
SetPlayerPos(playerid, -2523.8162,2239.3862,5.3984);
SetPlayerInterior(playerid, 0);
return 1;
}
Reply
#7

thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)